// FormMainChildDlg12Sub03_02.cpp : implementation file
//

#include "stdafx.h"
#include "diabetes.h"
#include "FormMainChildDlg12Sub03_02.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFormMainChildDlg12Sub03_02 dialog


CFormMainChildDlg12Sub03_02::CFormMainChildDlg12Sub03_02(CString sz_title,CWnd* pParent /*=NULL*/)
	: CDialog(CFormMainChildDlg12Sub03_02::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFormMainChildDlg12Sub03_02)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	this->m_sz_title = sz_title;
}


void CFormMainChildDlg12Sub03_02::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFormMainChildDlg12Sub03_02)
	DDX_Control(pDX, IDC_STATIC_16, m_26);
	DDX_Control(pDX, IDC_STATIC_15, m_25);
	DDX_Control(pDX, IDC_STATIC_13, m_23);
	DDX_Control(pDX, IDC_STATIC_14, m_24);
	DDX_Control(pDX, IDC_STATIC_12, m_22);
	DDX_Control(pDX, IDC_STATIC_11, m_21);
	DDX_Control(pDX, IDC_STATIC_TITLE, m_title);
	DDX_Control(pDX, IDC_TAB_WEB, m_sub_frame_tab);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFormMainChildDlg12Sub03_02, CDialog)
	//{{AFX_MSG_MAP(CFormMainChildDlg12Sub03_02)
	ON_BN_CLICKED(IDC_STATIC_11, OnStatic21)
	ON_BN_CLICKED(IDC_STATIC_12, OnStatic22)
	ON_BN_CLICKED(IDC_STATIC_13, OnStatic23)
	ON_BN_CLICKED(IDC_STATIC_14, OnStatic24)
	ON_BN_CLICKED(IDC_STATIC_15, OnStatic25)
	ON_BN_CLICKED(IDC_STATIC_16, OnStatic26)
	ON_WM_LBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFormMainChildDlg12Sub03_02 message handlers

BOOL CFormMainChildDlg12Sub03_02::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//
	ImageButton_Initial();
	//
	::SetShapeWindowSkin(this->m_hWnd, "IDD_FORM_MAIN_CHILD_DLG12_SUB03_01");
	this->m_title.SetWindowText(this->m_sz_title);
	m_sub_frame_tab.AddPage("m_dlg0201",&m_dlg0201,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_01);
	m_sub_frame_tab.AddPage("m_dlg0202",&m_dlg0202,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_02);
	m_sub_frame_tab.AddPage("m_dlg0203",&m_dlg0203,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_03);
	m_sub_frame_tab.AddPage("m_dlg0204",&m_dlg0204,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_04);
	m_sub_frame_tab.AddPage("m_dlg0205",&m_dlg0205,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_05);
	m_sub_frame_tab.AddPage("m_dlg0206",&m_dlg0206,IDD_FORM_MAIN_CHILD_DLG12_SUB03_02_06);
	m_sub_frame_tab.Show();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CFormMainChildDlg12Sub03_02::OnStatic21() 
{
	ImageButton_AllNormal();
	m_21.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(0);
}

void CFormMainChildDlg12Sub03_02::OnStatic22() 
{
	ImageButton_AllNormal();
	m_22.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(1);
}

void CFormMainChildDlg12Sub03_02::OnStatic23() 
{
	ImageButton_AllNormal();
	m_23.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(2);
}

void CFormMainChildDlg12Sub03_02::OnStatic24() 
{
	ImageButton_AllNormal();
	m_24.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(3);
}

void CFormMainChildDlg12Sub03_02::OnStatic25() 
{
	ImageButton_AllNormal();
	m_25.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(4);
}

void CFormMainChildDlg12Sub03_02::OnStatic26() 
{
	ImageButton_AllNormal();
	m_26.SetPressed(TRUE);
	m_sub_frame_tab.SetCurSel(5);
}

void CFormMainChildDlg12Sub03_02::ImageButton_Initial()
{
	m_21.Initial(TRUE,IDB_BITMAP_02_10,IDB_BITMAP_02_11);
	m_22.Initial(FALSE,IDB_BITMAP_02_20,IDB_BITMAP_02_21);
	m_23.Initial(FALSE,IDB_BITMAP_02_30,IDB_BITMAP_02_31);
	m_24.Initial(FALSE,IDB_BITMAP_02_40,IDB_BITMAP_02_41);
	m_25.Initial(FALSE,IDB_BITMAP_02_50,IDB_BITMAP_02_51);
	m_26.Initial(FALSE,IDB_BITMAP_02_60,IDB_BITMAP_02_61);
}

void CFormMainChildDlg12Sub03_02::ImageButton_AllNormal()
{
	m_21.SetPressed(FALSE);
	m_22.SetPressed(FALSE);
	m_23.SetPressed(FALSE);
	m_24.SetPressed(FALSE);
	m_25.SetPressed(FALSE);
	m_26.SetPressed(FALSE);
}
void CFormMainChildDlg12Sub03_02::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CDialog::OnLButtonDown(nFlags, point);
	PostMessage( WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM( point.x, point.y));
}
